<!DOCTYPE >
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>基本设置</title>

  <link rel="stylesheet" type="text/css" href="/system/css/right.css">
  <script type="text/javascript" src="/system/js/jquery.js"></script>
  <script type="text/javascript" src="/system/js/system.js"></script>
  <script type="text/javascript" src="/system/js/admin.js"></script>
	<script type="text/javascript" src="/system/js/ajaxupload.js"></script>
	<!-- 百度编辑器 -->
	<script type="text/javascript" src="/ueditor/ueditor.config.js"></script>
	<script type="text/javascript" src="/ueditor/ueditor.all.js"></script>
	<!-- /百度编辑器 -->
	<style>

	.setting .setting_t{
		padding-top:0;
	}

</style>

</head>
<body style="overflow: auto;">
	<div class="basic bor">
			<div class="title fl">当前位置：单页管理 > 添加/修改单页</div>

	</div>
	<div class="notice">
			<div class="n_title">
				<span class="fl">添加/修改单页</span>

</div>
<div class="ncontent">
<form action="{:url('Page/addpages')}" method="post" enctype="multipart/form-data" >
	<div class="setting">
		<input type="hidden" name="id" value="{$detail.id??''}">

		<ul>

			<li>
				<dd class="setting_t fl"><span>*</span>单页名称 ：</dd>
				<dd class="setting_p fl"><input class="seinp" type="text" name="name" value="{$detail.name??""}">
					<!-- <span>产品名称不能为空</span> -->
				</dd>
			</li>

			<li>
				<dd class="setting_t fl"><span>*</span>选择分类 ：</dd>
				<dd class="setting_p fl">
				<select name="uid" id="uid">
						{if condition="$detail['id']??'' NEQ '' "}
					{volist name="classname" id="lis"}
					<option value="{$lis.id??''}" {if condition="$lis['id'] eq $detail['uid'] "} selected="selected" {/if}>{$lis.name??''}</option>

					{/volist}
						{else /}
							{volist name="classname" id="lis"}
						<option value="{$lis.id??''}" >{$lis.name??''}</option>

						{/volist}
						 {/if}
				</select>
				</dd>
			</li>

			<li>
				<dd class="setting_t fl"><span>*</span>排序 ：</dd>
				<dd class="setting_p fl">
				<input class="seinp" type="text" name="sort" value="{$detail.sort??''}" >

				</dd>
			</li>

			<li >
					<dd class="setting_t fl"><span>*</span>单页缩略图 ：</dd>
					<dd class="setting_p fl colorfont">
							<div class="infx">
						<input class="infile " type="file" name="pic1" id="J_dy_img1">
						<span class="text_s">添加</span>
						</div>

									<a  class='liLabel'  ><img src='{$detail.pic??''}'  num_id ='1'  height='50px;' style='margin-left:10px;'>
										<input class='pic'  name='pic' type='hidden' value="{$detail.pic??''}" >
									</a>

						</dd>
						<script type="text/javascript">
						//上传图片
								$('#J_dy_img1').change(function(event) {
								var formData = new FormData();
								formData.append("file", $(this).get(0).files[0]);
								console.info(formData);
								$.ajax({
									 url:"/admin/product/ajaxuploads.html",
									 type:'POST',
									 data:formData,
									 cache: false,
									 contentType: false,    //不可缺
									 processData: false,    //不可缺
									 success:function(data){
										 var res = JSON.parse(data);
											$('[num_id=1]').attr('src',res.path);
											$('.pic').val('');
											$(".pic").val(res.path);
									 }
								});
								});
							//删除图片
							function delpic(id){
								var flag = confirm("确定删除吗?");
								            if(!flag){
								             return false;
								            }
									$('[num_id='+id+']').remove();

							}
						</script>
			</li>

			<li>
				<dd class="setting_t fl">备注 ：</dd>
				<dd class="setting_p fl"><textarea name="remarks" class="textarea bor">{$detail.remarks??''}</textarea></dd>
			</li>

			<li style="margin-top: 31px; display: block;">
				<dd class="setting_t fl"><span>*</span>内容 ：</dd>
				<dd class="setting_p fl">
						<textarea name="content" class="textarea textared" id ='container'>{$detail.content??''}</textarea>
						<script type="text/javascript">
								var ue = UE.getEditor('container', {
									initialFrameWidth:800,
									initialFrameHeight:500

								});
							</script>
				</dd>
			</li>

			<li>
				<dd class="setting_t fl"> &nbsp;</dd>
				<dd class="setting_p fl">
				<input type="hidden" name="id" value="{$detail.id??''}">
				<input class="submit" type="submit" value="保存">

				</dd>
			</li>
		</ul>


	</div>
	</form>
</div>
	</div>
 </script>



</body>
</html>
